package com.heraleign.mybatis.controller;

import com.heraleign.mybatis.service.StuService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Api(tags={"采用配置文件的学生管理"})
public class StuController {
    @Resource
    StuService service;

    @ResponseBody
    @GetMapping("/stu")
    public Object getStuById(@RequestParam("id")Long id){
        return service.getStuById(id);
    }

    @ResponseBody
    @GetMapping("/all")
    public Object selectAll(){
        return service.selectAll();
    };

    @ResponseBody
    @GetMapping("/selectAgeLt40")
    public Object selectAgeLt40(){
        return service.selectAgeLt40();
    };

    @ResponseBody
    @GetMapping("/queryById")
    public Object queryById(@RequestParam("id")Long id){
        return service.queryById(id);
    }

}
